/*
 * conversionBackup.java
 *
 * Created on April 4, 2007, 5:39 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.samlam;

/**
 * Conversion Batch
 * @author Adam
 */
public class conversionBatch {
    
    /** Creates a new instance of conversionBatch */
    public conversionBatch() {
    }              
        
//        for(int i=0; i<readyList.size(); i++){
//            System.out.println("processing conversion batch.....");
//            Member member = conversionList.get(i);
//            String status = conversion.getStatus();
//           
//         
//            if(cal.getTimeInMillis() <= now){
//                ///createCreditCardExpiredEmail()                             //implement this....
//            }else{
//                Date endDate = member.getconversionEndDate();
//                long conversionEndDate = endDate.getTime();
//                if(conversionEndDate <= now){
//                    //renewSubscription(member);
//                    member.setconversionEndDate(today);
//                    //createconversionSubscriptionRenewedEmail()             ///implement this....
//                }
//            }//else
//        }//for
//    }//process
//    
//    private void makeConversion(Member member)throws DataException{
//        try{
//            //create the transaction and corresponding line and revenue source
//            Transaction trans = TransactionDAO.getInstance().create();
//            TransactionLine txLine = TransactionLineDAO.getInstance().create();
//            conversion conversion = conversionDAO.getInstance().create();
//            txLine.setRevenueSource(conversion);
//            List<TransactionLine> txLineList = new LinkedList<TransactionLine>();
//            txLineList.add(txLine);
//            trans.setTxLinesList(txLineList);
//           
//            
//            // set pending
//            Payment pmt = PaymentDAO.getInstance().create();
//            pmt.setType("Pending");
//            double conversionSize = member.getconversion().getSize();
//            //calculate how much to charge customer depending on how much space they have purchased
//            double totalCost = conversion.getTotalPriceByconversionSize(BUSize);
//            pmt.setAmount(totalCost);
//            
//            //save transaction and modified membership
//            UpdateController.getInstance().post_conversion(member,trans);
//            System.out.println("conversion was complete");
//        }catch(Exception e){
//            throw new DataException("Could not do conversion.",e);
//        }
//    }
    
}//conversionBatch